<template>
	<div class="channel">
		<fnav></fnav>
		<second-nav :tid="Parent_tid"></second-nav>
		<!--vuex例子-->
		<!--<span @click="add">{{getCount}}</span>-->
		<cont></cont>
		<router-view/>
		<div class="index__law__src-partition-">
			<p>哔哩哔哩 沪ICP备13002172号-3</p>
			<p>信息网络传播视听节目许可证：0910417</p>
		</div>
	</div>
</template>

<script>
	import secondNav from "components/secondNav/secondNav"
	import content from "components/content/content"
	import fnav from "components/nav/nav";
	export default {
		name: "channel",
		data() {
			return {
				Parent_tid: this.$route.params.tid
//				count:this.$store.state.count
			}
		},
		computed:{
//			count(){
//				return this.$store.state.count
//			},
			getCount(){
				return this.$store.getters.getCount
			},
		},
		components: {
			"secondNav": secondNav,
			"cont":content,
			fnav
		},
		  watch:{
		  	$route(newValue,oldValue){
		  		if(newValue.path.indexOf("channel")){
		  			//实时更新vuex中state里面的curtid
		  			this.$store.commit("setCurTid",{
		  				curTid:newValue.params.tid
		  			})
		  			this.Parent_tid=newValue.params.tid;
		  		}
		  		
		  	}
		  },
		methods: {
//			PchangeTid(tid) {
//				//	  		tid来自于子组件
//				this.Parent_tid = tid;
//			},
			add(){
				this.$store.commit('increment')
			}
		}
	}
</script>

<style>
.index__law__src-partition-{
	font-size: 12px;
    color: #999;
    line-height: 2;
	text-align: center;
}
</style>